#include "list.h"

namespace yyp
{
	void ListTest1()
	{
		list<int> l1;
		list<int> l2(5);
		list<int> l3(5, 3);
		list<int> l4{ 1, 2, 3, 4, 5 };
		list<int> l5(l4.begin(), l4.end());
		list<int> l6(++l4.begin(), --l4.end());

		Print(l1);
		Print(l2);
		Print(l3);
		Print(l4);
		Print(l5);
		Print(l6);
		cout << "****************\n";

		list<int> l7 = l6;

		Print(l7);
		l7 = l4;
		Print(l7);
	}

	void ListTest2()
	{
		list<int> l1;

		l1.push_back(6);
		l1.push_back(7);
		l1.push_back(8);
		l1.push_back(9);
		l1.push_front(5);
		l1.push_front(4);
		l1.push_front(3);
		l1.push_front(2);
		l1.push_front(1);
		Print(l1);

		l1.front() = 10;
		l1.back() = 90;
		Print(l1);

		l1.pop_back();
		Print(l1);
		l1.pop_back();
		Print(l1);
		l1.pop_front();
		Print(l1);
		l1.pop_front();
		Print(l1);

		l1.erase(++l1.begin());
		l1.erase(--l1.end());
		Print(l1);
	}
}

int main()
{
	yyp::ListTest1();
	yyp::ListTest2();

	return 0;
}